#ifndef _LISTNODE_H
#define _LISTNODE_H

//#include "tasks.h"

#include "list.h"
#include "nodebuf.h"

#include "stdint.h"
#include "nodebuf.h"
#include "evtqueue.h"




typedef enum
{
    HEAD_ADD,   /**> 头插 */
    TAIL_ADD    /**> 尾插 */
}insert_order_t;


typedef enum
{
    POSI_READ = 0,  /**> 正序 */
    REVER_READ  /**> 逆序 */
}read_order_t;


typedef struct 
{
    struct list_head list;
    struct nodebuf_t listbuf; // buffer in list
} list_head_node;



typedef struct 
{
    struct list_head list;
    
    EVT_T data;               // please rewrite with other data value

} list_node;


void list_init_withbuf(list_head_node *lists, void *buf, int buflen) ;
void list_write(list_head_node *lists, insert_order_t local, EVT_T  listEvent);
uint8_t list_read(list_head_node *lists, read_order_t order, uint16_t num, EVT_T *evt);
uint8_t list_delete(list_head_node *lists, EVT_T evt);
uint16_t get_list_num(list_head_node *lists);



#endif



